<html>
<head>
<meta charset="utf-8">
<title>天气API测试</title>
<script src="src/js/jquery-1.11.2.min.js"></script>
<script src="src/js/highcharts.js"></script>
<script src="src/js/highcharts-3d.js"></script>
</head>
<body>
<div align="left" id="head">

	<h1 class="font1">一叶`金陵</h1>
</div>
<input type="button" id="getweather" value="获取天气数据">
<button onClick="hs()">显示隐藏文字</button>
<h1 id="wenzi">显示隐藏文字</h1>
<div id="showweather">

</div>

</body>
</div>
</html>
<script language="javascript" type="text/javascript">
/*
	$("#getweather").click(function(){
		$.ajax("http://wthrcdn.etouch.cn/WeatherApi",{
			type:"GET",
			//dataType:"xml",
			data:{"city":"南京"},
			success: function(data){
				alert(data);
			}
		})
	})
*/
	$("#getweather").click(function(){
		
		$.get("http://wthrcdn.etouch.cn/weather_mini",
		{city:"涟水"},function(alldata){
			alert(alldata);
			alert(json.data.aqi);
			})
		/*
		$.getJSON("http://wthrcdn.etouch.cn/weather_mini",
		{city:"南京"},function(json){
			alert(json);
			
			/*
			cName = json.data.city;
			nTem = json.data.wendu;
			Ganmao = json.data.ganmao;
			toAqi = json.data.aqi;
			//今天的基本信息
			
			
			toFengxiang = json.data.forecast[0].fengxiang;
			toFengli = json.data.forecast[0].fengli;
			toGaowen = json.data.forecast[0].high;
			toDiwen = json.data.forecast[0].low;
			toType = json.data.forecast[0].type;
			toDate = json.data.forecast[0].date;
			//今天的详细数据(1)
			
			secFengxiang = json.data.forecast[1].fengxiang;
			secFengli = json.data.forecast[1].fengli;
			secGaowen = json.data.forecast[1].high;
			secDiwen = json.data.forecast[1].low;
			secType = json.data.forecast[1].type;
			secDate = json.data.forecast[1].date;
			//明天的详细数据(2)
			
			thrFengxiang = json.data.forecast[1].fengxiang;
			thrFengli = json.data.forecast[1].fengli;
			thrGaowen = json.data.forecast[1].high;
			thrDiwen = json.data.forecast[1].low;
			thrType = json.data.forecast[1].type;
			thrDate = json.data.forecast[1].date;
			//后天的详细数据(3)
			
			fouFengxiang = json.data.forecast[2].fengxiang;
			fouFengli = json.data.forecast[2].fengli;
			fouGaowen = json.data.forecast[2].high;
			fouDiwen = json.data.forecast[2].low;
			fouType = json.data.forecast[2].type;
			fouDate = json.data.forecast[2].date;
			//大后天的详细数据(4)
			
			fifFengxiang = json.data.forecast[3].fengxiang;
			fifFengli = json.data.forecast[3].fengli;
			fifGaowen = json.data.forecast[3].high;
			fifDiwen = json.data.forecast[3].low;
			fifType = json.data.forecast[3].type;
			fifDate = json.data.forecast[3].date;
			//大大后天的详细数据(5)
			
			yesFengxiang = json.data.yesterday.fx;
			yesFengli = json.data.yesterday.fl;
			yesGaowen = json.data.yesterday.high;
			yesDiwen = json.data.yesterday.low;
			yesType = json.data.yesterday.type;
			yesDate = json.data.yesterday.date;
			//昨天的详细数据
			})
	*/		
			
	/*		
			var date1 = yesDate;
			alert(data1);
			//getX = [yesDate,toDate,secDate,thrDate,fouDate,fifDate];
			function getX(){
				
				return getX;
				}
        $("#showweather").highcharts({
	        title: {
            text: '最近五天的气温',
            x: -20 //center
        },
        subtitle: {
            text: '一叶金陵',
            x: -20
        },
        xAxis: {
            categories: getX(),
        },
        yAxis: {
            title: {
                text: 'Temperature (°C)'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            valueSuffix: '°C'
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: [{
            name: 'Tokyo',
            data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
        }, {
            name: 'New York',
            data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
        }, {
            name: 'Berlin',
            data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]
        }, {
            name: 'London',
            data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
        }]
    });
	*/
	
	//})
	})
	function hs(){
	$("#wenzi").fadeToggle(500);
	}	
</script>
